package org.madgecko.api.uitl;

import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * Author       : MadFrog
 * Date         : 2018/11/10 0:04
 * Description  :
 */
public class UEditorCommonsMultipartResolver extends CommonsMultipartResolver {

    @Override
    public boolean isMultipart(javax.servlet.http.HttpServletRequest request) {
        String uri = request.getRequestURI();
//        System.out.println(uri);
        //过滤使用百度UEditor的URI
        if (uri.indexOf("ueditor/dispatch") > 0) {     //此处拦截路径即为上面编写的controller路径
//            System.out.println("commonsMultipartResolver 放行");
            return false;
        }
//        System.out.println("commonsMultipartResolver 拦截");
        return super.isMultipart(request);
    }

}
